package com.digitalchina.lxnsy.viewholder;

import android.view.ViewGroup;
import android.widget.TextView;

import com.digitalchina.lxnsy.R;
import com.digitalchina.lxnsy.entity.TechnologyVO;
import com.digitalchina.lxnsy.toolkit.TimeUtil;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.viewholder
 * 创建人：白彦东
 * 创建时间：2016/12/28 18:10
 * 修改备注：
 * ================================================
 */

public class AnswerQuestionListHolder extends BaseViewHolder<TechnologyVO.QuestionBean> {

    private TextView tvAnswerQuestionTitle; // 问题
    private TextView tvAnswerQuestionTime; // 发布问题时间


    public AnswerQuestionListHolder(ViewGroup parent) {
        super(parent, R.layout.item_technology_answer);
        tvAnswerQuestionTitle = $(R.id.item_answer_tv_question);
        tvAnswerQuestionTime = $(R.id.item_answer_tv_question_time);
    }

    @Override
    public void setData(TechnologyVO.QuestionBean questionVO) {
        super.setData(questionVO);
        tvAnswerQuestionTitle.setText(questionVO.getTitle() == null ? "" : questionVO.getTitle());
        tvAnswerQuestionTime.setText(questionVO.getCreateTime() == null ? "" : TimeUtil.getDatebefore(questionVO.getCreateTime()));
    }
}
